package com.jz.community.basecomm.reflection.share;

import android.content.Context;

import com.jz.community.basecomm.bean.ShareInfo;
import com.jz.community.basecomm.reflection.ModuleReflectUtils;

/**
 * Created by Tony.Fan on 2018/6/13 13:42
 * 通过反射调用分享模块对外公开方法
 */
public class ShareActionReflectUtils {

    /**
     * 要反射的类名
     */
    public static final String JUMP_ACTION_CLASS_NAME = "com.jz.community.sharesdk.share.JumpActionUtils";

    /**
     * 跳转页面的方法名
     */
    public static final String JUMP_PAGE_METHOD_NAME = "jumpSharePage";


    /**
     * 跳转页面
     *
     * @param context
     * @param shareInfo
     */
    public static void jumpSharerPage(Context context, ShareInfo shareInfo) {
        ModuleReflectUtils.notReturnMethod(JUMP_ACTION_CLASS_NAME, JUMP_PAGE_METHOD_NAME,
                new Class[]{Context.class, ShareInfo.class}, new Object[]{context, shareInfo}, true);
    }

    /**
     * 跳转页面
     *
     * @param context
     * @param shareInfo
     */
    public static void jumpSharerPage(Context context, ShareInfo shareInfo, ShareClickListener shareClickListener) {
        ModuleReflectUtils.notReturnMethod(JUMP_ACTION_CLASS_NAME, JUMP_PAGE_METHOD_NAME,
                new Class[]{Context.class, ShareInfo.class, ShareClickListener.class}, new Object[]{context, shareInfo, shareClickListener}, true);
    }

}
